<include file="Public:header" />
<style type="text/css">
.upload_c{ width:187px; height:124px; border:1px solid #c6c6c6; background:#fafafa; margin:0 auto; text-align:center;}
.upload_c select{ width:162px; height:23px; line-height:23px; margin:23px 0 18px 0;}
.upload_btn{ background:url(upload_bt.jpg) no-repeat; width:157px; height:42px; border:none;}
</style>
<link href="../Public/personal/css/edit.css" rel="stylesheet" type="text/css" />
<script language='javaScript'>
$(document).ready(function(){
        $('#nickname').blur(function(){
		  var reg = /^\s*$/g;
		  var length=$(this).val().length; 
		  if($('#nickname').val()=="" || reg.test($('#nickname').val())){
			  $('#tit').html("<font class= 'wrong' color='red'>昵称不能为空</font>");
			  return false;
		  } else if(length>12||length<2){
			  $('#tit').html("<span><font class= 'wrong' color='red'>必须是2~12个字符</font></span>"); 
			  return false;
		  }else{ 
			  $('.wrong').remove();
			  
		  }
	  }).keyup(function(){
			 $(this).triggerHandler('blur');
	  });
	  $('#but').click(function(){
		  $('#nickname').trigger('blur');
		  var numError=$('.wrong').length;
		  if(numError) return false; 
		  else{
			  alert('保存成功！');
			  $('#foom').submit();
			  }
			  
	  });
})
</script>

<div class="content">
<div class="crumbs">当前位置：<a href="{:U('Personal/index')}">个人空间</a> > <a href="#">编辑资料</a> > <a href="#">基本信息</a></div>
<div class="w_content">
<div class="c_l">
<div class="c_lt">
<div class="per_info">
<eq name='basic.image' value=''><img src="__PUBLIC__/Uploads/PersonImage/per_img.jpg" />
<else/><img src="__PUBLIC__/Uploads/PersonImage/s_{$basic['image']}"/>
</eq>
<div class="pinfo">
<p class="pname">{$basic['nickname']|msubstr=###,0,5}</p>
<p class="plevel">等 级：{$basic['lname']}</p>
<p class="pintegral">积 分：{$basic['score']}分</p>
<a href="{:U('user/logout')}" ><input onclick="window.location.href='{:U('user/logout')}'" style="cursor:pointer;" type="button" value="退出系统" class="exit_btn"/></a>
</div>
<div class="clear"></div>
</div>
<ul>
<li class="resources"><a href="{:U('Personal/mysource')}">我的资源</a></li>
<li class="favorite"><a href="{:U('Personal/favorite')}">我的收藏夹</a></li>
<li class="edit">
<dl>
<dt>
<a href="{:U('Personal/basicinfo')}">编辑资料</a>
</dt>
<dd><a href="{:U('Personal/basicinfo')}" class="current">基本信息</a></dd>
<dd><a href="{:U('Personal/password')}">修改密码</a></dd>
<dd><a href="{:U('Personal/image')}">修改头像</a></dd>
</dl>
</li>
<li class="friend"><a href="{:U('Personal/friend')}">我的好友</a></li>
<li class="message"><a href="{:U('Personal/message')}">短消息({$urcount}未读)</a></li>
</ul>
</div>
<div class="c_lb">
<div class="upload_c">
<select id="cate">
<option value="1">图片</option>
<option value="2">视频</option>
<option value="3">动画</option>
<option value="4">游戏</option>
<option value="5">文章</option>
<option value="6">挂图</option>
<option value="7">图书</option>
<option value="8">展品</option>
<option value="9">知识题</option>
</select>
<img style="cursor:pointer;" src="../Public/personal/images/upload_bt.jpg" onclick="upload();" />
</div>
</div>
</div>
<div class="c_m">
<div class="c_mtab">
<form action="{:U('Personal/basicinfo')}" method='post' id='foom'> 
<table cellpadding="0" cellspacing="0" border="0">
<tbody>
<tr>
<td colspan="2" class="tabtittle" height="70">基本信息</td>
</tr>
<tr>
<td height="40" ><font color='red'>*</font>昵 称：</td>
<td align="left"><input type="text" name='nickname' class="etext" id='nickname' value='{$basic.nickname}' maxlength="6"/></td>
<td width='220px' align='left'><span style='margin-left:6px' id='tit'><font color='#ccc'>须是2~6个字符</font></span></td>
</tr>
<tr>
<td height="40">性 别：</td>
<td align="left"><input type="radio" value='1' <eq name='basic.sex' value='1'>checked="checked" </eq>name="sex" /><span class="man">男</span><input type="radio"  value='2' <eq name='basic.sex' value='2'>checked="checked" </eq>name="sex"/><span class="woman">女</span></td>
<td ></td>
</tr>
<!--<tr>
<td height="40">出生日期：</td>
<td align="left"><input id="year" name="year" type="text" maxlength="4" style="width:83px;height:23px" />年<input id="moth" name="moth" type="text" style="width:81px;height:23px " maxlength="2" />月<input id="day" name="day" type="text" style="width:81px;height:23px"  maxlength="2" />日</td>
</tr>-->
<tr>
<td height="40">住址：</td>
<td align="left"><input type="text" class="etext" maxlength="50" name='address' value='{$basic.address}'/></td>
<td></td>
</tr>
<tr>
<td height="40">电话号码：</td>
<td align="left"><input type="text" onkeyup="value=value.replace(/[^\d]/g,'')"
      onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="11" class="etext" name='tel' value='{$basic.tel}'/></td>
<td></td>
</tr>
<tr>
<td height="70">&nbsp;</td>
<td align="center"><input type="button"  value='' class="save_bt" id='but'/></td>
<td></td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div class="footer">
<a href="#">版权声明</a>
|
<a href="#">联系我们</a>
|</li>
<a href="#">关于我们</a>
|</li>
<a href="#">关于隐私</a>
<p>版权信息</p>
</div>
<script type="text/javascript">
function upload()
{
	var cate=$("#cate").val();

	switch (parseInt(cate))
	{
		case 1:window.location.href="{:U('Picture/upload')}";break;
		case 2:window.location.href="{:U('Video/upload')}";break;
		case 3:window.location.href="{:U('Flash/upload')}";break;
		case 4:window.location.href="{:U('Game/upload')}";break;
		case 5:window.location.href="{:U('Article/upload')}";break;
		case 6:window.location.href="{:U('Image/upload')}";break;
		case 7:window.location.href="{:U('Book/upload')}";break;
		case 8:window.location.href="{:U('Exhibits/upload')}";break;
		case 9:window.location.href="{:U('Knowledge/upload')}";break;
	}
}
</script>
<include file="Public:footer" />
